import { Toast, Dialog } from "antd-mobile";

const success = (message:React.ReactNode,afterClose:() => void = () => {},duration:number = 2000) =>
{
    Toast.show({
        content:message,
        afterClose,
        duration,
        icon:'success'
    });
}

const fail = (message:React.ReactNode,afterClose:() => void = () => {},duration:number = 2000) =>
{
    Toast.show({
        content:message,
        afterClose,
        duration,
        icon:'fail'
    });
}

const confirm = Dialog.confirm;

export {
    success,
    fail,
    confirm
}